﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

/// <summary>
/// 设备状态 正常、异常
/// </summary>
[PrimaryKey("ls_id", "ls_d_guid")]
[Index("ls_response_state", Name = "idcontectstate")]
[Index("ls_d_guid", Name = "idxlcuguid", IsUnique = true)]
[Index("ls_guid", Name = "idxlguid")]
[Index("ls_live_state_set_time", Name = "idxstartime")]
[Index("ls_live_state", Name = "idxstatus")]
public partial class iot_device_live_state
{
    [Key]
    public long ls_id { get; set; }

    public string ls_guid { get; set; }

    /// <summary>
    /// 设备iot_device
    /// </summary>
    [Key]
    [StringLength(50)]
    public string ls_d_guid { get; set; }

    /// <summary>
    /// 状态0未知待检测状态，1正常，2异常,3检测状态中，100打开，101关闭&apos;,
    /// </summary>
    public int ls_live_state { get; set; }

    /// <summary>
    /// 状态更新时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? ls_live_state_set_time { get; set; }

    /// <summary>
    /// 状态备注
    /// </summary>
    [StringLength(255)]
    public string ls_live_state_remark { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? ls_add_time { get; set; }

    /// <summary>
    /// 连接通讯状态，0正常，1不正常
    /// </summary>
    public int? ls_response_state { get; set; }

    /// <summary>
    /// 断连时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? ls_unresponse_time { get; set; }
}
